package com.funny.learning.english.db;

import android.database.sqlite.SQLiteDatabase;
import android.util.Log;

public class DBDefine {
	public static String TABLE_GAME = "tbl_game";
	
	
	public static String COLUMN_GAME_ID_KEY = "id_key";
	public static String COLUMN_GAME_IID = "iid";
	public static String COLUMN_GAME_definition = "definition";
	public static String COLUMN_GAME_name = "name";
	public static String COLUMN_GAME_searchEN = "searchEN";
	public static String COLUMN_GAME_searchVI = "searchVI";
	public static String COLUMN_GAME_url = "url";
	public static String COLUMN_GAME_id = "id";
	public static String COLUMN_GAME_lname = "lname";
	public static String COLUMN_GAME_laudio = "laudio";
	public static String COLUMN_GAME_lphonetics = "lphonetics";
	public static String COLUMN_GAME_lcontext = "lcontext";
	public static String COLUMN_GAME_lreminiscence = "lreminiscence";
	public static String COLUMN_GAME_ldefinition = "ldefinition";
	public static String COLUMN_GAME_slugTopic = "slugTopic";
	public static String COLUMN_GAME_slugSubTopic = "slugSubTopic";
	public static String COLUMN_GAME_slugGameType = "slugGameType";
	public static String COLUMN_GAME_DATE = "date";
	 private static final String DATABASE_CREATE_GAME = "create table " + TABLE_GAME + "(" 
				 + COLUMN_GAME_ID_KEY +  " integer primary key autoincrement, " 
				 + COLUMN_GAME_IID + " integer ,"
				 + COLUMN_GAME_definition + " text ,"
				 + COLUMN_GAME_name + " text ,"
				 + COLUMN_GAME_searchEN + " text ,"
				 + COLUMN_GAME_searchVI + " text ,"
				 + COLUMN_GAME_url + " text ," 
				 + COLUMN_GAME_id + " text ,"
				 + COLUMN_GAME_lname + " text ,"
				 + COLUMN_GAME_laudio + " text ," 
				 + COLUMN_GAME_lphonetics + " text ," 
				 + COLUMN_GAME_lcontext + " text ," 
				 + COLUMN_GAME_lreminiscence + " text ," 
				 + COLUMN_GAME_ldefinition + " text ," 
				 + COLUMN_GAME_slugTopic + " text ," 
				 + COLUMN_GAME_slugSubTopic + " text ," 
				 + COLUMN_GAME_slugGameType + " text ," 
				 + COLUMN_GAME_DATE + " integer);";
	// db and vs name
	public static final String DATABASE_NAME = "english.db";
	public static final int DATABASE_VERSION = 1;
	  
	  public static void onCreate(SQLiteDatabase database) {
			database.execSQL(DATABASE_CREATE_GAME);
		}

		public static void onUpgrade(SQLiteDatabase database, int oldVersion,
				int newVersion) {
			Log.w(DBDefine.class.getName(), "Upgrading database from version "
					+ oldVersion + " to " + newVersion
					+ ", which will destroy all old data");
			database.execSQL("DROP TABLE IF EXISTS " + TABLE_GAME);
			onCreate(database);
		}
}
